import unittest

import requests
class MyTestCase1(unittest.TestCase):

    def setUp(self):
        # 实例化session对象
        self.session = requests.Session()

        self.url_login = "http://ihrm-java.itheima.net/api/sys/login"
        # teardown

    def tearDown(self):
        # 关闭session对象
        self.session.close()
        # 登录成功

    def test_success(self):
        # 发送验证码请求并断言

        login_data = {
            "mobile": "13800000002",
            "password": "123456",

        }
        login_header = {
            "Content-Type": "application/json"
        }
        response = self.session.post(url=self.url_login, json=login_data)
        print(response.json())
        self.assertEqual(200, response.status_code)

        # 账号不存在

